package com.sunyard.utils.Response;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 返回信息
 *
 * @author DUANYUBIN
 * @date 2020-07-08 15:27
 **/
@ApiModel(value = "返回信息")
@Data
public class BaseResult<T> {

    /**
     * 返回成功
     */
    public static final String CODE_DATA = "00";

    public static final String CODE_SUCCESS = "00";

    /**
     * 返回失败 错误信息自己定义
     */
    public static final String CODE_FAIL = "01";

    public static final String CODE_NULL = "03";

    /**
     * 系统异常
     */
    public static final String CODE_ERR = "99";

    //密码重置
    public static final String RET_RESET = "02";
    /**
     * 成功响应信息
     */
    public static final String MESSAGE_SUCCESS = "SUCCESS";

    /**
     * 系统异常响应
     */
    public static final String MESSAGE_ERR = "系统异常";

    /**
     * 响应码
     */
    @ApiModelProperty(value = "响应码 00-成功 01-失败 99-系统异常")
    private String dataCode;

    /**
     * 响应信息
     */
    @ApiModelProperty(value = "响应信息")
    private String dataMessage;

    /**
     * 返回数据
     */
    @ApiModelProperty(value = "返回数据")
    private T data;

    public BaseResult() {
    }

    public BaseResult(String dataCode) {
        this.dataCode = dataCode;
    }

    public BaseResult(String dataCode, String dataMessage) {
        this.dataCode = dataCode;
        this.dataMessage = dataMessage;
    }

    public BaseResult(String dataCode, String dataMessage, T data) {
        this.dataCode = dataCode;
        this.dataMessage = dataMessage;
        this.data = data;
    }

}
